package com.cxl.controller;


import com.cxl.entity.Type;
import com.cxl.service.ITypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 崔学磊
 * @since 2022-03-16
 */
@RestController
@RequestMapping("/type")
public class TypeController {

    @Autowired
    private ITypeService iTypeService;

    @Value("${server.port}")
    private String port;

    @GetMapping(value = "/gettypelist")
    public List<Type> gettypelist() {
//        int i = 1 / 0;
        System.out.println("负载均衡演示"+port);
        return iTypeService.typeList();
    }
}
